package com.ayi.servlet.backstage; /**
 * @author Ayingzz
 * @create 2021/12/6 23:44
 */

import com.ayi.dao.userdao.UpdateUser;

import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.annotation.*;
import java.io.IOException;

@WebServlet(name = "editAdminFromUsersServlet", value = "/editAdminFromUsersServlet")
public class editAdminFromUsersServlet extends HttpServlet {

    @Override
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        int id = Integer.parseInt(request.getParameter("userid"));
        String username = request.getParameter("username");
        String password = request.getParameter("password");
        if (new UpdateUser().updateAdminFromUsers(id, username, password)) {
            response.sendRedirect("UserManageServlet");
        } else {

        }
    }
}
